﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Factory
{
    public partial class MenuPrincipal : Form
    {
  
        public MenuPrincipal()
        {
            InitializeComponent();
        }

        private void btnManterRegras_Click(object sender, EventArgs e)
        {
            ManterRegras regras = new ManterRegras();
            regras.Show();
            this.Hide();
        }

        private void MenuPrincipal_Load(object sender, EventArgs e)
        {
            if (Sessao.usuarioLogado == null || Sessao.usuarioLogado.TipoFuncionario == 0)
            {
                btnAdcionarFuncionario.Hide();
                btnAdcionarFuncionario.Visible = false;

                btnManterRegras.Hide();
                btnManterRegras.Visible = false;
            }
        }

        private void btnNovoUsuario_Click(object sender, EventArgs e)
        {
            ManterFuncionario cadContribuidor = new ManterFuncionario();
            cadContribuidor.Show();
            this.Hide();
        }

        private void btnManterCheque_Click(object sender, EventArgs e)
        {
            CadastroCheque cadCk = new CadastroCheque();
            cadCk.Show();
            this.Hide();
        }

        private void btnManterCliente_Click(object sender, EventArgs e)
        {
            ManterCliente mantercliente = new ManterCliente();
            mantercliente.Show();
            this.Hide();


       
        }

        protected override bool ProcessCmdKey(ref Message message, Keys keys)
        {
            switch (keys)
            {
                case Keys.F1:
                    //Process action here.
                    CadastrarCliente cadastrarcliente = new CadastrarCliente();
                    cadastrarcliente.Show();
                    this.Hide();
                    return false;
                case Keys.F2:
                    //Process action here.
                    ManterCliente mantercliente = new ManterCliente();
                    mantercliente.Show();
                    this.Hide();
                    return false;
                case Keys.F3:
                    //Process action here.
                    CadastroCheque cadastrocheque = new CadastroCheque();
                    cadastrocheque.Show();
                    this.Hide();
                    return false;
                case Keys.F5:
                    //Process action here.
                    CompensarCheque compensarcheque = new CompensarCheque();
                    compensarcheque.Show();
                    this.Hide();
                    return false;
                case Keys.F6:
                    //Process action here.
                    CadastroFuncionario cadastrofuncionario = new CadastroFuncionario();
                    cadastrofuncionario.Show();
                    this.Hide();
                    return false;
                case Keys.F7:
                    //Process action here.
                    ManterFuncionario manterfunc = new ManterFuncionario();
                    manterfunc.Show();
                    this.Hide();
                    return false;
                case Keys.F8:
                //    //Process action here.
                    CadastroContribuidor adicionarsocio = new CadastroContribuidor();
                    adicionarsocio.Show();
                    this.Hide();
                    return false;
                case Keys.F9:
                    //Process action here.
                    //ManterSocio mantersoc = new ManterSocio();
                    //mantersoc.Show();
                    //this.Hide();
                    return false;
                case Keys.F10:
                    //Process action here.
                    SaidaContribuidor sairsocio = new SaidaContribuidor();
                    sairsocio.Show();
                    this.Hide();
                    return false;
                case Keys.F11:
                    //Process action here.
                    ManterRegras manterregra = new ManterRegras();
                    manterregra.Show();
                    this.Hide();
                    return false;
                case Keys.F12:
                    //Process action here.
                    TrocarCheque trocarcheque = new TrocarCheque();
                    trocarcheque.Show();
                    this.Hide();
                    return false;
                case Keys.A:
                    //Process action here.
                    CalculoPagamentoCliente calculopagamento = new CalculoPagamentoCliente();
                    calculopagamento.Show();
                    this.Hide();
                    return false;
                case Keys.Escape:
                    //Process action here.
                    DialogResult result2 = MessageBox.Show("Deseja realmente sair?",
        "Sair do Sistema?",
        MessageBoxButtons.YesNo,
        MessageBoxIcon.Question);

                    if (result2 == DialogResult.Yes)
                    {
                        Login login = new Login();
                        login.Show();
                        this.Hide();
                    }
                    return false;
            }
            return false;
        }

        private void cadastrarClienteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            CadastrarCliente cadastrarcliente = new CadastrarCliente();
            cadastrarcliente.Show();
            this.Hide();
        }

        private void buscarClientesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ManterCliente mantercliente = new ManterCliente();
            mantercliente.Show();
            this.Hide();
        }

        private void cadastrarFuncionárioF5ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            CadastroFuncionario cadastrofuncionario = new CadastroFuncionario();
            cadastrofuncionario.Show();
            this.Hide();
        }

        private void cadastrarChequesF3ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            CadastroCheque cadastrocheque = new CadastroCheque();
            cadastrocheque.Show();
            this.Hide();
        }

        

        private void compensarChequesF5ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            CompensarCheque compensar = new CompensarCheque();
            compensar.Show();
            this.Hide();
        }

        private void buscarFuncionárioF6ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ManterFuncionario manterfunc = new ManterFuncionario();
            manterfunc.Show();
            this.Hide();
        }

        private void cadastrarSóciosF7ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            CadastroContribuidor newsocio = new CadastroContribuidor();
            newsocio.Show();
            this.Hide();
        }

        private void saídaSócioF10ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SaidaContribuidor outsocio = new SaidaContribuidor();
            outsocio.Show();
            this.Hide();
        }


        private void regrasToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ManterRegras regras = new ManterRegras();
            regras.Show();
            this.Hide();
        }

        private void sairF12ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult result2 = MessageBox.Show("Deseja realmente sair?",
        "Sair do Sistema?",
        MessageBoxButtons.YesNo,
        MessageBoxIcon.Question);

            if (result2 == DialogResult.Yes)
            {
                Login login = new Login();
                login.Show();
                this.Hide();
            }
        }

        private void btnAdicionarSocio_Click(object sender, EventArgs e)
        {
            CadastroContribuidor contri = new CadastroContribuidor();
            contri.Show();
            this.Hide();
        }

    }
}
